package com.lhk.appframework.manager;

import com.lhk.appframework.MyApplication;

import android.content.Context;

public class ImplManagerAppUserDefault extends BaseManager implements ManagerAppUser{


	
	private static ImplManagerAppUserDefault instance = null;
	private ImplManagerAppUserDefault(Context context) {
		this.context = context;
	}
	public static ImplManagerAppUserDefault getInstance(Context context){
		if(instance == null){
			synchronized (ImplManagerAppUserDefault.class) {
				if(instance == null){
					instance = new ImplManagerAppUserDefault(context);
				}
			}
		}
		return instance;
	}
	
	private Context context;
	
	

	@Override
	public int getSplahGo2TypeUI(Context context) {
		int typeUI = TYPEUI_LOGO;
		
		if(isShowGuidedUI(context)){
			typeUI = TYPEUI_GUIDED;
			return typeUI;
		}
		
		if(isShowAdvertisementUI(context)){
			typeUI = TYPEUI_ADVERTISEMENT;
			return typeUI;
		}
		
		return typeUI;
	}

	private boolean isShowGuidedUI(Context context){
		ManagerSharedPreferences managerSP = MyApplication.getInstance().getManagerSP();
		boolean isFirstUse = (Boolean) managerSP.get(context, ManagerSharedPreferences.SPNAME, ManagerSharedPreferences.SPNAME_KEY_ISFIRSTUSE, true);
		return isFirstUse;
	}
	
	// 是否在Splash 显示广告
	private boolean isShowAdvertisementUI(Context context){
		
		
		
		return false;
	}
	
}
